package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.reporting.entity.CmInteCoLonInfoCi;
import com.jrx.anytxn.reporting.service.IXibService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @comment: 当日还款信息明细Processor
 * @author: liuzb
 * @date: 2021/11/27 10:16
 */
@Service
public class LoanInfoCiProcessor implements ItemProcessor<CmInteCoLonInfoCi, CmInteCoLonInfoCi> {


    @Autowired
    private IXibService iXibService;

    private static final Logger logger = LoggerFactory.getLogger(LoanInfoCiProcessor.class);


    @Override
    public CmInteCoLonInfoCi process(CmInteCoLonInfoCi loanInfoCi) throws Exception {
        try {
            if (null != loanInfoCi || StringUtils.isNotBlank(loanInfoCi.getDubilNo())) {
                return iXibService.assemLoanInfoCi(loanInfoCi);
            }
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("LoanInfoCiProcessor 出错了：{}", e.getMessage());
        }
        return null;
    }
}
